﻿using Heima.OA.IBLL;
using Heima.OA.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Heima.OA.BLL
{
    public partial class ZS_LogService: BaseService<ZS_Log>, IZS_LogService
    {
        /// <summary>
        /// 添加日志
        /// </summary>
        /// <param name="businessType">业务类型</param>
        /// <param name="dataId">关联数据ID</param>
        /// <param name="content">日志内容</param>
        /// <param name="createOperator">添加人名字</param>
        /// <param name="createOperatorId">添加人ID</param>
        /// <returns></returns>
        public bool AddLog(int businessType, int dataId, string content, string createOperator, int createOperatorId)
        {
            ZS_Log log = new ZS_Log();
            log.BusinessType = (short)businessType;
            log.DataId = dataId;
            log.Content = content;
            log.CreateTime = DateTime.Now;
            log.CreateOperator = createOperator;
            log.CreateOperatorId = createOperatorId;

            Add(log);
            return DbSession.SaveChanges()>0;
        }

    }
}
